/* GUI CONVERTED from rechrp.p (converter v1.75) Wed Aug 16 23:18:21 2000 */
/* rechrp.p - PRODUCTION LINE CHANGE-OVER REPORT                        */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rechrp.p (converter v1.00) Fri Oct 10 13:57:17 1997 */
/* web tag in rechrp.p (converter v1.00) Mon Oct 06 14:17:42 1997 */
/*F0PN*/ /*K0Y0*/ /*                                                    */
/*V8:ConvertMode=FullGUIReport                                 */
/* REVISION: 7.0    LAST MODIFIED: 10/18/91     BY: smm *F230*        */
/* REVISION: 7.0    LAST MODIFIED: 03/29/92     BY: emb *F331*        */
/* REVISION: 7.0    LAST MODIFIED: 05/26/92     BY: emb *F530*        */
/* REVISION: 8.6    LAST MODIFIED: 10/14/97     BY: gyk *K0Y0*        */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 07/28/00 BY: *N0GD* Ganga Subramanian */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K0Y0*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rechrp_p_1 "Change-Over!Hours"
/* MaxLen: Comment: */

&SCOPED-DEFINE rechrp_p_2 "Production Line"
/* MaxLen: Comment: */

/*N0GD* &SCOPED-DEFINE rechrp_p_3 "(Cont.)"*/
/*N0GD* /* MaxLen: Comment: */ */

/* ********** End Translatable Strings Definitions ********* */

define   variable line    like   chg_line.
define   variable line1   like   chg_line.
define   variable site    like   chg_site.
define   variable site1   like   chg_site.
define   variable part    like   chg_from.
define   variable part1   like   chg_from.
define   variable partto  like   chg_to.
define   variable partto1 like   chg_to.
define   variable from_des1 like   pt_desc1.
define   variable from_des2 like   pt_desc1.
define   variable to_des1 like   pt_desc1.
define   variable to_des2 like   pt_desc1.
/*N0GD*/ define variable msg1 as character format "x(10)" no-undo.

/*K0Y0*
{mfdtitle.i "b+ "} /*F530*/
*K0Y0*/

/*N0GD*/ msg1 = getTermLabel("CONT",10).


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
  
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
line    colon 20
  line1   colon 45 label {t001.i}
  site    colon 20
  site1   colon 45 label {t001.i}
  part    colon 20
  part1   colon 45 label {t001.i}
  partto  colon 20
  partto1 colon 45 label {t001.i}
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

site = global_site.
site1= global_site.

/*K0Y0*/ {wbrp01.i}

/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

   if line1   = hi_char   then line1 = "".
   if site1   = hi_char   then site1 = "".
   if part1   = hi_char   then part1 = "".
   if partto1 = hi_char   then partto1 = "".

/*K0Y0*/ if c-application-mode <> 'web' then
         
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K0Y0*/ {wbrp06.i &command = update &fields = "  line line1 site site1
 part part1 partto partto1" &frm = "a"}

/*K0Y0*/ if (c-application-mode <> 'web') or
/*K0Y0*/ (c-application-mode = 'web' and
/*K0Y0*/ (c-web-request begins 'data')) then do:

   bcdparm = "".
   {mfquoter.i line}
   {mfquoter.i line1}
   {mfquoter.i site}
   {mfquoter.i site1}
   {mfquoter.i part}
   {mfquoter.i part1}
   {mfquoter.i partto}
   {mfquoter.i partto1}

   if line1   = ""  then line1 = hi_char.
   if site1   = ""  then site1 = hi_char.
   if part1   = ""  then part1 = hi_char.
   if partto1 = ""  then partto1 = hi_char.

/*K0Y0*/ end.
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



   {mfphead.i}

   for each chg_mstr no-lock where (chg_line >= line and chg_line <= line1)
   and (chg_site >= site and chg_site <= site1)
   and (chg_from >= part and chg_from <= part1)
   and (chg_to >= partto and chg_to <= partto1)
/*F530*/ break by chg_site by chg_line
   with frame b width 132 no-attr-space:

      FORM /*GUI*/ 
     chg_site
     chg_line  column-label {&rechrp_p_2}
/*F530*/ pt_desc1
     chg_from format "x(27)"
     chg_to   format "x(27)"
     chg_time  column-label {&rechrp_p_1}
      with STREAM-IO /*GUI*/  frame b down width 132.

      /* SET EXTERNAL LABELS */
      setFrameLabels(frame b:handle).

      assign to_des1 = ""
         to_des2 = ""
       from_des1 = ""
       from_des2 = "".

      find pt_mstr no-lock where pt_part = chg_from no-error.
      if available pt_mstr then
     assign from_des1 = pt_desc1
        from_des2 = pt_desc2.

      find pt_mstr no-lock where pt_part = chg_to no-error.
      if available pt_mstr then
     assign to_des1 = pt_desc1
        to_des2 = pt_desc2.

/*F530*/ find ln_mstr no-lock where ln_line = chg_line
/*F530*/ and ln_site = chg_site no-error.

/*F530*  if page-size - line-counter < 3 then page. */
/*F530*/ if page-size - line-counter < 3 then do:
/*F530*/    page.
/*F530*/    if first-of (chg_line) = false then
/*F530*/    display chg_site chg_line
/*N0GD*             {&rechrp_p_3}  */
/*N0GD*/            msg1
                @ pt_desc1 with frame b STREAM-IO /*GUI*/ .
/*F530*/ end.

/*F530*/ if first-of (chg_line) then
        display chg_line  column-label {&rechrp_p_2}
        chg_site
        /*K0Y0*
/*F530*/    ln_desc when available ln_mstr @ pt_desc1
           *K0Y0*/
          /*K0Y0*/   ln_desc when (available ln_mstr) @ pt_desc1
/*F530*/ with frame b STREAM-IO /*GUI*/ .

/*F530*/ display
        chg_from
        chg_to
        chg_time
     with frame b down width 132 STREAM-IO /*GUI*/ .

      if from_des1 <> "" or to_des1 <> "" then do with frame b:
     down 1.
     display "   " + from_des1 @ chg_from
         "   " + to_des1 @ chg_to WITH STREAM-IO /*GUI*/ .
      end.

      if from_des2 <> "" or to_des2 <> "" then do with frame b:
     down 1.
     display "   " + from_des2 @ chg_from
         "   " + to_des2 @ chg_to WITH STREAM-IO /*GUI*/ .
      end.

      
/*GUI*/ {mfguirex.i } /*Replace mfrpexit*/

    end.

    
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

end. /* repeat */

/*K0Y0*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" line line1 site site1 part part1 partto partto1 "} /*Drive the Report*/
